<!-- 富文本编辑器 -->
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/vendor/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/vendor/plugins/ueditor/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/vendor/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/js/ajaxfileupload.js"></script>
<style type="text/css">
  .w240{width: 240px;}
  .sml-240{padding-left: 240px;}
</style>

<div id="content" class="">
        <div class="row">
          <div class="col-md-12">
            <!-- Input Fields -->
            <div class="panel">
              <div class="panel-heading">

                <span class="panel-title">网站基本信息设置</span>
              </div>
              <div class="admin-form theme-primary mw1000 center-block" style="padding-bottom: 175px; margin-top:30px;">
              <div class="panel heading-border panel-primary">
                <form method="post" action="{:U('System/doAdvantage')}"  >


                <?php
                  for ($i = 0; $i < 3; $i++) {
                  $advantage = $advantages[$i];
                  $index = $i + 1;
                ?>


                <div class="panel-body bg-light">
                <div><h2>优势{$index}配置</h2></div>
                <div class="section">
                  <div class="smart-widget sm-left sml-160">
                    <label class="field prepend-icon">
                      <input type="text" name="title{$i}" id="advantage-title{$i}" class="gui-input" placeholder="此处输入优势标题：：必填" value="{$advantage['title']}">
                    </label>
                    <label  class="button btn-primary w240" >优势名称{$index}：</label>
                  </div>
                </div>

                <div class="row">
                  <div class="col-md-8">
                    <span class="fileupload-preview thumbnail m5" >
                        <img src="{$advantage['img']}" class="img-responsive" id="advantage-img-{$i}">
                    </span>

                    <input type="file" class="gui-file" style="width:0px" name="adv{$i}" id="advantage-{$i}" onchange="ajaxuploadImg('advantage-{$i}','advantage-ipt-{$i}','{:U('Ajax/uploadImg')}','advantage-img-{$i}');">
                    <input type="hidden" id="advantage-ipt-{$i}" name="img{$i}" value="{$advantage['img']}">
                    <!-- <input type="hidden" name="bid" value="{$product['id']}"> -->
                  </div>
                  <div class="col-md-4">
                    <span class="fileupload-preview  m5 pull-right"><button type="button" onclick="getinputclick('advantage-{$i}');" class="btn active btn-primary btn-block">上传图片</button></span>
                  </div>
                  
                </div>

                <div class="section">
                    <h3>优势详情1：</h3>
                    <textarea id="editor{$i}" style="height:300px;" name="desc{$i}">{$advantage['desc']}</textarea>
                </div>
              </div>



                <?php
                  }
                ?>


                  <div class="panel-footer text-right">
                    <button type="submit" class="button btn-primary">提交</button>
                    <button type="reset" class="button btn-primary">清空</button>
                  </div>
                  <!-- end .form-footer section -->




                </form>

              </div>

            </div>
            </div>
          </div>
        </div>
</div>


<script type="text/javascript">
var ue = UE.getEditor('editor0');

  function getinputclick(id){
      var dom = $("#"+id);
      dom.click();
  }

  UE.getEditor('editor1');

  function getinputclick(id){
      var dom = $("#"+id);
      dom.click();
  }

  UE.getEditor('editor2');

  function getinputclick(id){
      var dom = $("#"+id);
      dom.click();
  }
</script>
